package com.hxkj.controller;

import com.hxkj.domain.po.MqInfo;
import com.hxkj.service.MqInfoService;
import com.platform.common.dispatcher.util.ResultStructUtils;
import com.platform.common.domain.result.ParameterDataStruct;
import com.platform.common.domain.result.ResultPageStruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 *  @desc mq消息队列管理界面
 *  @author yaosy
 *  @date 2018年9月6日15:04:31
 * **/
@RestController
@RequestMapping("/mqinfo")
public class MqInfoController {

    @Autowired
    private MqInfoService mqInfoService;


    /****
     *  分页查询队列界面
     *  parameterDataStruct
     * ***/
    @RequestMapping(value = "/getMqInfoList", method = RequestMethod.POST, consumes = "application/json;charset=UTF-8")
    public Callable<ResultPageStruct<MqInfo>> getMqInfoList(@RequestBody ParameterDataStruct<MqInfo> parameterDataStruct) throws Exception {
        return () -> ResultStructUtils.buildResultPageStruct(mqInfoService.getMqInfoList(parameterDataStruct.getData() == null ?
                new MqInfo() : parameterDataStruct.getData(), parameterDataStruct.getPageTo()), "param=value");
    }
}
